Skip to content

chore: resolve staticcheck/lint findings - #608

Open
rc4 wants to merge 7 commits into
go-ldap:masterfrom
rc4:cleanup
Open

chore: resolve staticcheck/lint findings#608
rc4 wants to merge 7 commits into
go-ldap:masterfrom
rc4:cleanup

Conversation

@rc4

@rc4 rc4 commented Jun 20, 2026

Copy link
Copy Markdown

While reading through the codebase to learn more about the library my editor automatically linted the project and came back with these findings - these seemed like they would be helpful fixes.

  • Replaced deprecated io/ioutil with appropriate io/os functions
  • Changed interface{} to any, reflect.Ptr to Pointer
  • Made all error strings lowercase (excepting messages that start with an acronym or identifier)
  • Migrated deprecated go-ntlmssp ProcessChallenge/ProcessChallengeWithHash to NewAuthenticateMessage (see relevant docs for go-ntlmssp)
  • tidied up some switch statements/conditionals, incorrect godoc comments, and other minor tweaks

Again, hope this is helpful - please let me know if there's anything I need to fix/do/undo. :)

(Also - I'd be happy to throw together a golangci-lint config to help catch stuff like this easily in the future - if it'd be helpful.)

rc4 and others added 7 commits June 19, 2026 19:01
 - drop duplicate encoding/hex import alias enchex
 - replace deprecated io/ioutil import with io
 - migrate deprecated go-ntlmssp ProcessChallenge/ProcessChallengeWithHash/GetDomain to NewAuthenticateMessage
 - cleanup switch syntax
 - simplify pkt.Identifier.Tag to pkt.Tag via embedded promotion
 - make ControlServerSideSortingResult receiver names consistent
 - fix doc comment form on some types
 - cleanup switch syntax
 - ldap.go: replace deprecated io/ioutil with os.ReadFile; tidy up switch statement syntax
 - search.go: use any in lieu of interface{}, reflect.Ptr -> reflect.Pointer, tidy up doc comment
 - debug.go: use any in lieu of interface{}
 - gssapi/client.go: drop redundant embedded Client selector
 - examples_test.go: replace deprecated io/ioutil with os.ReadFile
 - search_test.go: use range syntax instaed of manual loop
 - error_test.go: rename panic_data to panicData per ST1003, drop redundant tt copy (no longer needed since go1.22)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant